#pragma once

#include<iostream>
#include<unordered_map>
#include<functional>
#include<stdlib.h>
#include<time.h>

using namespace std;

using work_t=function<void()>;
void log()
{
    cout<<"()"<<endl;
}

void download()
{
    cout<<"void download()"<<endl;
}

void kk()
{
     cout<<"kkkkkkkkkkkkkkkkkkkk()"<<endl;
}

struct taskmanager
{
 
    taskmanager()
    {
        srand(time(nullptr));
        hash[0]=log;
        hash[1]=download;
        hash[2]=kk;
    }

    int select()
    {
        return rand()%hash.size();
    }

    void excute(int task)
    {
        hash[task]();
    }





    unordered_map<int,work_t> hash;

    
};

struct taskmanager tm;